package com.hotel.mapper;

import com.hotel.entity.Bill;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface BillMapper {
    @Insert("insert into bill(check_in_id" +
            ",bill_number" +
            ",room_charges,service_charges,total_charges" +
            ",paid_amount,unpaid_amount) " +
            "values(#{checkInId}" +
            ",#{billNumber}" +
            ",#{roomCharges},#{serviceCharges},#{totalCharges}" +
            ",#{paidAmount},#{unpaidAmount})")
    void save(Bill bill);

    @Select("select * from bill where check_in_id=#{id}")
    Bill list(Long id);
}
